package com.tensquare.Exception;

import ch.qos.logback.core.encoder.EchoEncoder;
import entity.Result;
import entity.StatusCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class LabelException {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result errorLabel(Exception e){
        return new Result(false,StatusCode.ERROR, e.getMessage());

    }

}
